package com.nbsaas.boot.product.rest.resource;

import com.nbsaas.boot.product.api.apis.ProductSkuSpecValueApi;
import com.nbsaas.boot.product.data.entity.ProductSkuSpecValue;
import com.nbsaas.boot.product.api.domain.request.ProductSkuSpecValueRequest;
import com.nbsaas.boot.product.api.domain.response.ProductSkuSpecValueResponse;
import com.nbsaas.boot.product.api.domain.simple.ProductSkuSpecValueSimple;
import com.nbsaas.boot.product.rest.convert.ProductSkuSpecValueSimpleConvert;
import com.nbsaas.boot.product.rest.convert.ProductSkuSpecValueEntityConvert;
import com.nbsaas.boot.product.rest.convert.ProductSkuSpecValueResponseConvert;
import com.nbsaas.boot.product.data.repository.ProductSkuSpecValueRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   商品SKU规格值-业务接口实现
*/
@Transactional
@Service
public class ProductSkuSpecValueResource extends BaseResource<ProductSkuSpecValue,ProductSkuSpecValueResponse, ProductSkuSpecValueSimple, ProductSkuSpecValueRequest>  implements ProductSkuSpecValueApi {

    @Resource
    private ProductSkuSpecValueRepository productSkuSpecValueRepository;

    @Override
    public JpaRepositoryImplementation<ProductSkuSpecValue, Serializable> getJpaRepository() {
        return productSkuSpecValueRepository;
    }

    @Override
    public Function<ProductSkuSpecValue, ProductSkuSpecValueSimple> getConvertSimple() {
        return new ProductSkuSpecValueSimpleConvert();
    }

    @Override
    public Function<ProductSkuSpecValueRequest, ProductSkuSpecValue> getConvertForm() {
        return new ProductSkuSpecValueEntityConvert();
    }

    @Override
    public Function<ProductSkuSpecValue, ProductSkuSpecValueResponse> getConvertResponse() {
        return new ProductSkuSpecValueResponseConvert();
    }




}


